package com.allen.action;
import com.allen.dao.LoginDao;

public class LoginAction {

    private String username;
    private String password;
    private String tip;

    public String execute() {
        boolean flag = new LoginDao().login(username, password);
        if (flag) {
            new LoginDao().updateTime(username,password);
            return "success";
        } else {
            setTip("用户名或密码错误");
            return "error";
        }
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTip() {
        return tip;
    }

    public void setTip(String tip) {
        this.tip = tip;
    }
}
